<template>
<el-container>
    <el-aside><el-row class="tac">
  <el-col :span="24">

    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      width='300px'
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>部门管理</span>
        </template>
        <el-menu-item-group>

          <el-menu-item index="1-1" @click="num=1">预览部门</el-menu-item>
          <el-menu-item index="1-2" @click="num=2">管理部门</el-menu-item>

        </el-menu-item-group>

      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>职责管理</span>
        </template>
        <el-menu-item-group>

          <el-menu-item index="2-1" @click="num=3">预览职责</el-menu-item>
          <el-menu-item index="2-2" @click="num=4">管理职责</el-menu-item>

        </el-menu-item-group>

      </el-submenu>
       <el-submenu index="3">
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>员工管理</span>
        </template>
        <el-menu-item-group>

          <el-menu-item index="3-1" @click="num=5">预览员工</el-menu-item>
          <el-menu-item index="3-2" @click="num=6">管理员工</el-menu-item>

        </el-menu-item-group>

      </el-submenu>
     
    </el-menu>
  </el-col>
</el-row></el-aside>

<el-main class="class1">
    <span v-if='num==1'>
        <!-- 表格的组件 -->
        <tables></tables>  
    </span> 
    <span v-if='num==2'>
        <!-- 增删改的组件 -->
        <zsg></zsg>
    </span>

    <span v-if='num==3'>
        <!-- 增删改的组件 -->
        <tables-2></tables-2>
    </span>
    <span v-if='num==4'>
        <!-- 增删改的组件 -->
        <zsg-2></zsg-2>
</span> 
        <span v-if='num==5'>
        <!-- 增删改的组件 -->
        <tables-3></tables-3>
    </span>
        <span v-if='num==6'>
        <!-- 增删改的组件 -->
        <zsg-3></zsg-3>

    </span>
</el-main>

    
</el-container>

  
</template>

<script>
import tables from '../components/table.vue'
import zsg from '../components/ZSG.vue'
import tables2 from '../components/table2.vue'
import zsg2 from '../components/ZSG2.vue'
import tables3 from '../components/table3.vue'
import zsg3 from '../components/ZSG3.vue'


export default {
    data(){
        return{
            num:0
        }
    },
    components:{
        tables,
        zsg,
        tables2,
        zsg2,
        tables3,
        zsg3,
        

    },
    methods:{

    }

}
</script>

<style>
.class1{
    background-color: rgb(226, 128, 177);
}


</style>